<%@ page contentType="text/html;charset=UTF-8" language="java"  import="java.io.*" %>
<html>
<head>
  <title>
   test
  </title>
</head>
<body>
<%

        BufferedReader bufferReader = new BufferedReader(request.getReader());
        String line = null;
        StringBuilder buffer = new StringBuilder();

        try
        {
            while ((line = bufferReader.readLine()) != null)
            {
                buffer.append(line);
            }
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        
        out.print(buffer.toString());
        out.print(request.getParameter("a"));
        out.println("<");
        out.println(request.getContextPath());
		out.println(">");

 %>
 
 <a href="/a/c.jsp">test</a>
 测试结果：<br/>
 1.有项目名的 为“/someapp”<br/>
 2.有项目名的 为“”<br/>
 </body>
 
